package com.shop.service.impl;

import java.util.List;

import com.shop.bean.Goods;
import com.shop.bean.Page;
import com.shop.dao.GoodsDao;
import com.shop.dao.impl.GoodsDaoImpl;
import com.shop.service.GoodsService;

public class GoodsServiceImpl implements GoodsService {

	GoodsDao goodsDao = new GoodsDaoImpl();

	@Override
	public Page<Goods> selectGoodsAll(int pageNum, int pageSize) {
		List<Goods> goodsList = goodsDao.selectGoodsAll(pageNum, pageSize);
		int rows = goodsDao.selectGoodsNumAll();
		Page<Goods> page = new Page(goodsList,pageNum,pageSize,rows);
		return page;

	}

	@Override
	public int delGoodsId(int goodsId) {
		return goodsDao.delGoodsId(goodsId);
	}
}
